<template>
    <my-dailog v-model:show="showFlag" :showtopclose="true" :styleType="2" @close="close">
        <div class="payDgBox">
            <div class="iconBox">
                <i class="iconfont icon-zhuyi-yin"></i>
                <p v-t="'goods.text13'">Please enter the metado password to complete the payment</p>
            </div>
            <div class="inputbox">
                <input type="password" v-model="pass"/>
            </div>
            <div class="mbzf-btnBox">
                <my-button text="Confirm" @click="paySubmit"/>
            </div>
        </div>
    </my-dailog>
</template>

<script>
import { reactive,toRefs,getCurrentInstance } from 'vue'
import {useRoute,useRouter} from 'vue-router'
import { useStore } from 'vuex'
import { toast } from '@/utils/common'
import { useI18n } from 'vue-i18n'
export default {
    components:{
       
    },
    props:{

    },
    emits:{  // teleport后，出发事件需要emits申明（vue3+）
        'confirm':null,
        'close':null
    },
    setup(props,context){
        const router = useRouter()
        const route = useRoute()
        const store = useStore()
        const {proxy} = getCurrentInstance()
        const {t} = useI18n()

        const state = reactive({
           showFlag:true,
           pass:''
        })

        const close = ()=>{
            context.emit('close')
        }
        const paySubmit = ()=>{
            if(!state.pass){
                return toast(t('goods.text27'))
            }
            context.emit('confirm',state.pass)
        }

        return{
            ...toRefs(state),
            close,
            paySubmit
        }
    }
}
</script>

<style lang="scss" scoped>
    .payDgBox{
        .iconBox{
            text-align: center;
            i{
                font-size: 130px;
                color: #49B4D2;
            }
            p{
                padding: 0 30px;
                line-height: 42px;
                font-family: Inter-Medium, Inter;
                font-weight: 500;
                color: #FFFFFF;
                font-size: 32px;
                margin: -10px 0 0 0;
            }
        }
        .inputbox{
            text-align: center;
            padding: 30px 0 0 0;
            input{
                height: 80px;
                line-height: normal;
                width: 90%;
                background: rgba(103,248,255,0.2000);
                border: 1px solid rgba(103,248,255,0.5000);
                padding: 0 30px;
            }
        }
        .mbzf-btnBox{
            width: 400px;
            margin: 50px auto 0 auto;
        }
    }
</style>